package thread.sync4;

public class SyncDemo4 {//检验不同方法的互斥现象，需要synchronized来进行配合
    public static void main(String[] args) {
        Boo boo=new Boo();
        Thread t1=new Thread(){
            @Override
            public void run() {
                boo.methodA();
            }
        };
        Thread t2=new Thread(){
            @Override
            public void run() {
                boo.methodB();
            }
        };
        t1.start();
        t2.start();
    }
}
